<?php
/**
 * 小说Dao
 */

class Dao_VisitModel extends Dao_BaseModel {

    protected $_table = 'visitor';

    const NORMAL_STATUS = 1;
    const INFO_KEYWORD = 'USER:INFO_KEY_';
    const EXTIME        = '86400';

    public function __construct ()
    {
        parent::__construct ();
    }
    
    public function getVisitor( $param = [] )
    {
        $where    = [];
        $where[]  = array( 'visit_ip' , $param['visit_ip'] );
        $where[]  = array( 'visit_ua' , $param['visit_ua'] );
        $info     = parent::getOne( array('*') , $where );
        return $info ? $info : false;
    }
    
    /**
     * 新增游客
     */
    public function addVisitor($data)
    {
        $info = parent::add ( $data );
        return $info;
    }
    
    /**
     * 修改游客
     * @param type $data
     * @return type
     */
    public function editVisitor( $data , $arr = [] )
    {
        $info = parent::edit( $data , $arr ); 
        return $info;
    }

}
